package com.cailu.rabmq.sender.sender;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.cailu.common.constant.SenderConfDirectExchangeCommon;

/**
 * @author cailu
 * @filename SenderConfDirectExchangeTemplate
 * @description
 * @date 2020/3/31 21:01
 */
@Component
public class SenderConfDirectExchangeTemplate {

	@Autowired
	private AmqpTemplate rabbitTemplate;

	public void sendDirectExchangeA(String str) {
		if ("".equals(str) || str == null) {
			rabbitTemplate.convertAndSend(SenderConfDirectExchangeCommon.DIRECT_EXCHANGE,
					SenderConfDirectExchangeCommon.DIRECT_QUEUE_A, " 广播模式 Direct Exchange bbb 路由");
		} else {
			rabbitTemplate.convertAndSend(SenderConfDirectExchangeCommon.DIRECT_EXCHANGE,
					SenderConfDirectExchangeCommon.DIRECT_QUEUE_A, str);
		}

	}

}
